package com.baoyouqun.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baoyouqun.entity.VipLevel;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;


@Mapper
public interface VipLevelMapper extends BaseMapper<VipLevel> {
    @Select("""
            <script>
                SELECT id, level_name 
                FROM vip_level 
                WHERE id IN 
                <foreach collection="vipLevelIds" item="levelId" open="(" separator="," close=")">
                    #{levelId}
                </foreach>
                AND status = 1 -- 仅查询启用的等级
            </script>
            """)
    List<VipLevel> selectBatchByLevelIds(List<String> vipLevelIds);
}